package com.otv.model;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;

@Inheritance(strategy = InheritanceType.JOINED)
@Entity
public abstract class Task {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long id;
	private String taskName;
	private String etiquette;
	private String couleur;
	private Integer numero;
	private TaskPerimetre taskPerimetre;
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinTable(name = "task_secteur", joinColumns = { @JoinColumn(name = "task_id", nullable = true, updatable = true) }, inverseJoinColumns = { @JoinColumn(name = "secteur_id", nullable = true, updatable = true) })
	private List<Secteur> relatedSecteur;
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinTable(name = "task_rayon", joinColumns = { @JoinColumn(name = "task_id", nullable = true, updatable = true) }, inverseJoinColumns = { @JoinColumn(name = "rayon_id", nullable = true, updatable = true) })
	private List<Rayon> relatedRayon;
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinTable(name = "task_magasin", joinColumns = { @JoinColumn(name = "task_id", nullable = true, updatable = true) }, inverseJoinColumns = { @JoinColumn(name = "magasin_id", nullable = true, updatable = true) })
	private List<Magasin> relatedMagasin;
	@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
	@JoinTable(name = "task_famille", joinColumns = { @JoinColumn(name = "task_id", nullable = true, updatable = true) }, inverseJoinColumns = { @JoinColumn(name = "famille_id", nullable = true, updatable = true) })
	private List<Famille> relatedFamille;

	public Integer getNumero() {
		return numero;
	}

	public void setNumero(Integer numero) {
		this.numero = numero;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getTaskName() {
		return taskName;
	}

	public void setTaskName(String taskName) {
		this.taskName = taskName;
	}

	public String getEtiquette() {
		return etiquette;
	}

	public void setEtiquette(String etiquette) {
		this.etiquette = etiquette;
	}

	public String getCouleur() {
		return couleur;
	}

	public void setCouleur(String couleur) {
		this.couleur = couleur;
	}

	public TaskPerimetre getTaskPerimetre() {
		return taskPerimetre;
	}

	public void setTaskPerimetre(TaskPerimetre taskPerimetre) {
		this.taskPerimetre = taskPerimetre;
	}

	public List<Secteur> getRelatedSecteur() {
		return relatedSecteur;
	}

	public void setRelatedSecteur(List<Secteur> relatedSecteur) {
		this.relatedSecteur = relatedSecteur;
	}

	public List<Rayon> getRelatedRayon() {
		return relatedRayon;
	}

	public void setRelatedRayon(List<Rayon> relatedRayon) {
		this.relatedRayon = relatedRayon;
	}

	public List<Magasin> getRelatedMagasin() {
		return relatedMagasin;
	}

	public void setRelatedMagasin(List<Magasin> relatedMagasin) {
		this.relatedMagasin = relatedMagasin;
	}

	public List<Famille> getRelatedFamille() {
		return relatedFamille;
	}

	public void setRelatedFamille(List<Famille> relatedFamille) {
		this.relatedFamille = relatedFamille;
	}

}
